﻿#include "Application.h"
#include "CreateMeshAction.h"
#include "Mesh.h"

void CreateMeshAction::Execute()
{
  _parser.SetPrefix("Mesh/");

  Configuration cfg;
  cfg.Add<Application*>("_app", &_app);
  cfg.Add<Parser*>("_parser", &_parser);

  auto type = cfg.Get<std::string>("type");
  _app.GetMesh() = ObjectFactory::Make<Mesh>(type, cfg);

  Success("CreateMeshAction");
}
